﻿<!--#include file="const.asp" -->
<!--#include file="common/funciton.asp" -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>

<%On Error Resume Next
	username=request.form("username")
	rdid=Request.querystring("rdid")
	fromwhere =request.form("fromwhere")
	homepage =request.form("homepage")
	email =request.form("email")
	text =request.form("text")
	text =replace(text,"<","<")
	Posttime =now()
	plid=Request.querystring("plid")

	if Request.querystring("t")="p" then
		Set objRootlist = diaryl.childNodes.item(rdid).childNodes.item(4)
	else
		Set objRootlist = diaryl.childNodes.item(rdid).childNodes.item(4).childNodes.item(plid).childNodes.item(7)
	end if

	if objRootlist.hasChildNodes then
		id = objRootlist.lastchild.firstchild.text+1
	else
		id=1
	end if

	brstr=chr(13)&chr(10)&chr(9)
	XMLnode=brstr&"<list>"&brstr & _
		"<id>"&id&"</id>"&brstr & _
		"<username>"&username&"</username>"&brstr & _
		"<fromwhere>"&fromwhere&"</fromwhere>"&brstr & _
		"<Posttime>"&Posttime&"</Posttime>"&brstr & _
		"<homepage>"&homepage&"</homepage>"&brstr & _
		"<email>"&email&"</email>"&brstr & _
		"<text>"&text&"</text>"&brstr & _
		"<hf></hf></list>"&chr(13)
	set WebsiteXmlDatas2=Server.CreateObject("Microsoft.XMLDOM")
	WebsiteXmlDatas2.loadXML(XMLnode)
	set rootNewNode=WebsiteXmlDatas2.documentElement
	objRootlist.appendChild(rootNewNode)
	WebsiteXmlDatas.save(strSourceFile)
	set WebsiteXmlDatas=nothing
	set WebsiteXmlDatas2=nothing
	Response.Redirect("../article.asp?id="&GDInfo("diary_id",rdid))
 
%>